<?php

include_once "Strategy/ConcreteStrategyA.php";
include_once "Strategy/ConcreteStrategyB.php";
include_once "Strategy/ConcreteStrategyC.php";
include_once "Context.php";
include_once "StrategyInterface.php";

use StrategyPattern\ {Context, StrategyInterface};
use StrategyPattern\Strategy\ {ConcreteStrategyA, ConcreteStrategyB, ConcreteStrategyC};

/** @var StrategyInterface 实例化指定策略类 ConcreteStrategyA */
$objectA = new ConcreteStrategyA();
$context = new Context($objectA);
$resultA = $context->contextStrategy();
echo $resultA . PHP_EOL;

/** @var StrategyInterface 实例化指定策略类 ConcreteStrategyB */
$objectB = new ConcreteStrategyB();
$context = new Context($objectB);
$resultB = $context->contextStrategy();
echo $resultB . PHP_EOL;

/** @var StrategyInterface 实例化指定策略类 ConcreteStrategyC */
$objectC = new ConcreteStrategyC();
$context = new Context($objectC);
$resultC = $context->contextStrategy();
echo $resultC . PHP_EOL;
